project('facial-recognition-core', 'cpp',
  version : '0.0.1',
  default_options : ['warning_level=3', 'cpp_std=c++20'])

src= [
  'src/main.cpp',
  'src/lib/webserver/web_server.h',
  'src/lib/webserver/web_server.cpp',
  'src/lib/service/ai_service.h',
  'src/lib/service/ai_service.cpp',
  'src/lib/controller/ai_controller.h',
  'src/lib/controller/ai_controller.cpp',
  'src/lib/data/data_store.h',
  'src/lib/data/data_store.cpp',
  'src/lib/base/system_config.h',
  'src/lib/base/system_config.cpp',
  'src/inc/arcsoft_face_sdk.h'
]

incdir = include_directories('src/inc/')

cxx = meson.get_compiler('cpp')

boost_dep = [
  cxx.find_library('boost_system'),
  cxx.find_library('boost_filesystem'),
  cxx.find_library('boost_thread'),
#  cxx.find_library('boost_log'),
#  cxx.find_library('boost_log_setup'),
  cxx.find_library('boost_locale'),
  cxx.find_library('boost_json')
]

# spdlog 依赖 fmt
fmt_dep = [
    cxx.find_library('fmt')
]

# arcsoft sdk
arcsoft_dep = [
    cxx.find_library('arcsoft_face'),
    cxx.find_library('arcsoft_face_engine')
]

opencv_dep = [
    cxx.find_library('opencv_core'),
    cxx.find_library('opencv_imgcodecs'),
    cxx.find_library('opencv_highgui'),
    cxx.find_library('opencv_imgproc')
]

sqlite_dep=dependency(['sqlite3'])
sqlite_dep_2 = [
    cxx.find_library('sqlitecpp')
]

add_project_arguments(['-lstdc++', '-ldl', '-w', '-DBOOST_LOG_DYN_LINK', '-DBOOST_JSON_STANDALONE', '-lm'], language : 'cpp')

# '.' will refer to current build directory
include_dirs = include_directories('.')


executable('facial-recognition-demo',
           src,
           dependencies: [boost_dep, fmt_dep, arcsoft_dep, opencv_dep, sqlite_dep, sqlite_dep_2],
           include_directories : [include_dirs],
           #install : true
           implicit_include_directories: true
)
